<div class="body" [cdkContextMenuTriggerFor]="menu">
<div> {{time}}</div> 
<div> {{data}}</div> 
</div>


<ng-template #menu>
    <div class="menu" cdkMenu> 
      <button class="menu-item"  cdkMenuItem  (click)="syncTime()" >同步时间</button> 
    </div>
</ng-template>